You are here: Grammar and Syntax > Flow Control Statements > IF Statements > Simple IF

Simple IF Statement

A simple IF Statement contains a single statement block. The calculation is performed only if the logical expression is true. If the logical expression is false, control passes to the next statement after the END keyword. Here is an example:

IF (@("FirstAmount") < 1000.00)  THEN             
$FinalAmount = @("FirstAmount") * .05; 
END;
RETURN ($FinalAmount)

Calculation

If the value of the section variable field FirstAmount is less than 1000.00, then the value is multiplied by .05 and entered in the target variable $FinalAmount. The value of the $FinalAmount target variable is then returned to the section variable field.

Note Use of the keyword connector THEN is optional.